package com.zx.service.Impl;

import com.zx.entity.User;
import com.zx.repository.UserRepository;
import com.zx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserRepository repository;

    @Override
    public User findUserInfoByUsername(String username) {
        return repository.findByUsername(username);
    }

    @Override
    public Page<User> find(PageRequest request) {
        Page<User> users = repository.findAll(request);
        return users;
    }

}
